import { useState } from "react";

function Form() {
  const [inputValue, setInputValue] = useState("");

  const handleInputChange = (e) => {
    setInputValue(e.target.value);
    console.log("当前输入框的值", inputValue);
  };
  return (
    <>
      <input
        type="text"
        value={inputValue}
        onChange={(e) => handleInputChange(e)}
      />
      <div>
        <button>按钮</button>
      </div>
    </>
  );
}

export default Form;
